package io.renren.modules.mqtt.service.impl;

import io.renren.modules.device.service.TDeviceService;
import io.renren.modules.mqtt.entity.MqttEvent;
import io.renren.modules.mqtt.service.IEventService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * //Add the class description
 *
 * @author lhb
 * @date 2023/6/12
 */
@Service("logoutEventService")
public class LogoutEventService implements IEventService {

    @Autowired
    private TDeviceService deviceService;
    @Override
    public boolean eventHandler(MqttEvent event) {
        return deviceService.updateOnlineStatus(event.getTerminalNo(), false);
    }

    @Override
    public String getMessType() {
        return "logout";
    }
}
